package net.simflow.swf.analyzer.exec.data;

import java.util.HashMap;
import java.util.TreeMap;

import net.simflow.swf.analyzer.network.data.Flow;
import net.simflow.swf.analyzer.network.data.Network;
import net.simflow.swf.analyzer.network.data.Service;

public class ExecResult {

	public static final String ORIGINAL_EXECUTION_RESULT = "Original Execution Result";
	public static final String TOTAL_STEP = "Total Setp";
	public static final String FLOW_CREATION_SPEED = "Flow Creation Speed";
	public static final String SERVICE_ABILITY = "Service Ability";
	public static final String SERVICE_SCHEDULE = "Service Schedule";
	public static final String FLOW_RELDEADLINE = "Flow Relative Deadline";
	public static final String FLOW_WEIGHT = "Flow Weight";

	private Network network;
	private int totalStep;
	private HashMap<Service, Integer> serviceAbilityMap = new HashMap<Service, Integer>();
	private HashMap<Service, Integer> serviceScheduleMap = new HashMap<Service, Integer>();
	private HashMap<Flow, Integer> flowWeightMap = new HashMap<Flow, Integer>();
	private HashMap<Flow, Integer> flowRelDeadlineMap = new HashMap<Flow, Integer>();
	private double flowCreateSpeed;
	private TreeMap<Integer, TaskExecResult> taskExecMap = new TreeMap<Integer, TaskExecResult>();

	public Network getNetwork() {
		return network;
	}

	public void setNetwork(Network network) {
		this.network = network;
	}

	public int getTotalStep() {
		return totalStep;
	}

	public void setTotalStep(int totalStep) {
		this.totalStep = totalStep;
	}

	public HashMap<Service, Integer> getServiceAbilityMap() {
		return serviceAbilityMap;
	}

	public void setServiceAbilityMap(HashMap<Service, Integer> serviceAbilityMap) {
		this.serviceAbilityMap.clear();
		this.serviceAbilityMap.putAll(serviceAbilityMap);
	}

	public HashMap<Service, Integer> getServiceScheduleMap() {
		return serviceScheduleMap;
	}

	public void setServiceScheduleMap(
			HashMap<Service, Integer> serviceScheduleMap) {
		this.serviceScheduleMap.clear();
		this.serviceScheduleMap.putAll(serviceScheduleMap);
	}

	public HashMap<Flow, Integer> getFlowWeightMap() {
		return flowWeightMap;
	}

	public void setFlowWeightMap(HashMap<Flow, Integer> flowWeightMap) {
		this.flowWeightMap.clear();
		this.flowWeightMap.putAll(flowWeightMap);
	}

	public HashMap<Flow, Integer> getFlowRelDeadlineMap() {
		return flowRelDeadlineMap;
	}

	public void setFlowRelDeadlineMap(HashMap<Flow, Integer> flowRelDeadlineMap) {
		this.flowRelDeadlineMap.clear();
		this.flowRelDeadlineMap.putAll(flowRelDeadlineMap);
	}

	public double getFlowCreateSpeed() {
		return flowCreateSpeed;
	}

	public void setFlowCreateSpeed(double flowCreateSpeed) {
		this.flowCreateSpeed = flowCreateSpeed;
	}

	public TreeMap<Integer, TaskExecResult> getTaskExecMap() {
		return taskExecMap;
	}

	public void setTaskExecMap(TreeMap<Integer, TaskExecResult> taskExecMap) {
		this.taskExecMap.clear();
		this.taskExecMap.putAll(taskExecMap);
	}
}
